home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7767 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: news1.cris.com!Crawford
  2. From: Crawford@cris.com (CRAWFORD)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Zombies & Daemons
  5. Date: 28 Feb 1996 20:36:02 GMT
  6. Organization: Concentric Internet Services
  7. Message-ID: <4h2ebi$kf5@spectator.cris.com>
  8. References: <3134348F.7526@citenet.net>
  9. Reply-To: crawford@iac.net
  10. NNTP-Posting-Host: mariner.cris.com
  11.  
  12. Oliver Lavery <oliver@citenet.net> writes:
  13. >I've just finished writting a daemon to handle generating web 
  14. >pages from an Oracle database. When it executes, the parent forks a 
  15. >number of children, all of which are bound to a network port. Each child 
  16. >services requests in order etc. etc. works more or less like an apache 
  17. >httpd...
  18.  
  19.     Sounds cool!
  20.  
  21. >    The problem is this: when one of the children dies for whatever 
  22. >reason (usually a f*cked OCI call which makes the daemons session 
  23. >unstable), the parent's sigcld handler forks a new child to keep a 
  24. >consistent number of processes running. For some reason, however, the 
  25. >dead child process lingers around as a zombie process ... how do I avoid 
  26. >this?
  27.  
  28.     Be sure to call wait(2) to harvest the child. It lets you
  29. retrieve the child's exit status, etc.
  30.  
  31. >    Also, does SunOS support copy on write memory pages? And do 
  32. >zombie processes still use system resources?
  33.  
  34.     I believe SunOS does copy on write. Zombie processes use very
  35. little in the way of resources, at most some entries in the kernel
  36. tables for the process information.
  37.  
  38. --
  39. "They sentenced me to twenty years of boredom, for trying to change
  40. the system from within."
  41. Robert Crawford                crawford@iac.net
  42. http://www.iac.net/~crawford
  43.